#pragma once
#include <osg/Vec3d>

#include "CmdHandler3.h"

class LineStrip2D;
class UCS;
class SelectHandler3D;
class Chamfer2DHandler : public CmdHandler3
{
	Q_OBJECT
public:
	Q_INVOKABLE Chamfer2DHandler();
	~Chamfer2DHandler();

	virtual void input(const QVariant& data, const QString& rawInput, CommandSource cs) override;

	bool getChoosePt(osg::Vec3d& pt);
	bool isValidChamferPoint(osg::Vec3d& end, osg::Vec3d& begin, osg::Vec3d& vec, SelectHandler3D* selector);

	static bool s_byAngle;//倒角方式
	static bool s_trim;//是否修剪
	static double s_dis1;
	static double s_dis2;
	static float s_angle;
	osg::Vec3d m_choosePt1;
	UCS* m_ucs;
	std::shared_ptr<LineStrip2D> m_line1;
	std::shared_ptr<LineStrip2D> m_line2;
};
